<template>
	<div class="child">
		<h2>我是Child组件</h2>
		<h3>我有一个玩具：{{toy}}</h3>
		<button @click="demo">测试</button>
	</div>
</template>

<script>
	export default {
		name:'Child',
		data() {
			return {
				toy:'奥特曼'
			}
		},
		methods: {
			demo(){
				this.$emit('send-toy',this.toy)
			}
		},
	}
</script>

<style scoped>
	.child{
		background-color: orange;
		padding: 20px;
	}
</style>